/*
 * Clears the memory of a particular area.
 * 
 * Thanks to Makagiga source code for referencing the org.makagiga.commons.crypto.CryptoUtils.java code.
 */
package org.passwordstore.util;

import java.util.Arrays;

/**
 *
 * @author thotheolh
 */
public class ClearMemory {

    public void ClearMemory() {
    }

    public void clearBytes(byte[] memspace) {
        if (memspace != null) {
            Arrays.fill(memspace, (byte) 0);
        }
    }

    public void clearLoginPassword(char[] password) {
        if (password != null) {
            Arrays.fill(password, '\0');
        }
    }
}
